package com.gc.server.vo.down;

import com.alibaba.excel.annotation.ExcelProperty;
import com.gc.server.entity.ImgOrderItemEntity;
import com.gc.server.vo.ImgOrderStatusEnum;
import com.gc.server.vo.ImgOrderVo;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@Data
public class ImgOrderItemDown {

    @ExcelProperty("店员名")
    private String name;

    @ExcelProperty("店员编号")
    private String code;

    @ExcelProperty("手机号")
    private String phone;

    @ExcelProperty("上级名")
    private String topName;

    @ExcelProperty("上级编号")
    private String topCode;

    @ExcelProperty("药店名")
    private String shopName;

    @ExcelProperty("药店区域")
    private String shopCity;

    @ExcelProperty("连锁")
    private String linkName;


    @ExcelProperty("产品名")
    private String goodsName;

    @ExcelProperty("数量")
    private Integer quantity;


    public ImgOrderItemDown() {

    }

    public ImgOrderItemDown(ImgOrderVo orderVo, ImgOrderItemEntity item) {
        this.name = orderVo.getUser().getName();
        this.code = orderVo.getUser().getCode();
        this.shopName = orderVo.getUser().getShopName();
        this.goodsName = item.getGoodsName();
//        this.quantity = item.getQuantity();
        this.quantity = 0;
        this.shopCity = orderVo.getUser().getCity();
        this.linkName = orderVo.getUser().getLinkName();
        this.phone = orderVo.getUser().getMobile();
        this.topName = orderVo.getTop().getName();
        this.topCode = orderVo.getTop().getCode();
    }

    public void add(Integer quantity){
        this.quantity+=quantity;
    }
}
